<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
</head>

<body>
    <script>
        //箭头函数
        //   function fn() {
        //     console.log(1)
        //   }

        //   fn()

        //   const fn = (参数（形参）) => {
        //     代码块（函数体）
        //   }

        //   正常调用即可
        //   fn()

        // const fn = (a, b) => {
        //     return a + b
        // }

        // console.log(fn(3, 4))

        // const fn = a => console.log(a)

        // fn(1)

        // const fn = (a, b) => a + b

        // console.log(fn(3, 4))

        //如果返回值是一个对象
        // const fn = () => ({ uname: 'ikun' })

        // console.log(fn());

        // const fn = () => console.log(1)

        // console.log(fn()); //console.log(1) // undefined
    </script>
</body>

</html>